package com.crawler.gmail.enums;

/**
 * <描述>
 * <详细介绍>
 *
 * @author 王明明
 * @since wiki
 */
public enum ChannelTypeEnum {

    // 拉勾
    LAGOU(1, "lagou", 1, 10),
    // 智联
    ZHILIAN(2, "zhilian", 2, 10),
    // 前程无忧
    WUYOU(3, "wuyou", 3, 10),
    // 猎聘
    LIEPIN(4, "liepin", 4, 10),
    //
    XMRC(5, "xmrc", 5, 0),
    // 丁香园
    DINGXIANG(6, "dingxiang", 6, 0),
    // 康强
    KQ36(7, "kangqiang", 7, 0),
    // 五八
    WUBA(8, "wuba", 8, 2),
    // 首都人才
    SDRC(9, "sdrc", 9, 0),
    // 脉脉
    MAIMAI(10, "maimai", 10, 1),
    // BOSS
    BOSS(11, "boss", 11, 10),
    // 实习僧
    SHIXI(12, "shixiseng", 12, 2),
    // 实习僧
    GRADUATE(18, "graduate", 18, 0),
    // 自定义渠道
    CUSTOM(22, "custom", 22, 1),
    // 汕头招聘
    SHANGTOU(23, "shantou", 23, 1),
    // 国际人才网
    GUOJIRENCAI(24, "guojirencai", 24, 1),
    // 建筑人才网
    BUILDHR(25, "buildhr", 25, 1),
    // 卓博人才
    ZHUOBO(26, "zhuobo", 26, 1),
    //
    ORIENTAL(27, "oriental", 27, 1),
    // 智通
    ZHITONG(28, "zhitong", 28, 1),
    // 大佛山
    DAFOSHANPERSONNEL(29, "dafoshan", 29, 1),
    // 新安人才网
    XINAN_TALENT(30, "xinanTalent", 30, 1),
    // 畜牧人才网
    XUMU_TALENT(31, "xumuTalent", 31, 1),
    MU_TONG_TALENT(32, "mutongTalent", 32, 1),
    CHENHR(33, "chenhr", 33, 1),
    //
    BEIJIXING(35, "beiJiXing", 35, 1);


    // value
    private Integer value;
    // targetName
    private String targetName;
    // 招聘的渠道ID，自定义渠道使用
    private Integer channelId;
    // 渠道频率
    private Integer rateLimit;

    ChannelTypeEnum(Integer value, String targetName, Integer channelId, Integer rateLimit) {
        this.value = value;
        this.targetName = targetName;
        this.channelId = channelId;
        this.rateLimit = rateLimit;
    }

    public static ChannelTypeEnum getChannelTypeByTargetName(String targetName) {
        switch (targetName) {
            case "lagou":
                return LAGOU;
            case "zhilian":
                return ZHILIAN;
            case "wuyou":
                return WUYOU;
            case "liepin":
                return LIEPIN;
            case "xmrc":
                return XMRC;
            case "dingxiang":
                return DINGXIANG;
            case "kangqiang":
                return KQ36;
            case "wuba":
                return WUBA;
            case "sdrc":
                return SDRC;
            case "maimai":
                return MAIMAI;
            case "boss":
                return BOSS;
            case "shixiseng":
                return SHIXI;
            case "graduate":
                return GRADUATE;
            case "custom":
                return CUSTOM;
            case "shantou":
                return SHANGTOU;
            case "guojirencai":
                return GUOJIRENCAI;
            case "buildhr":
                return BUILDHR;
            case "zhuobo":
                return ZHUOBO;
            case "oriental":
                return ORIENTAL;
            case "zhitong":
                return ZHITONG;
            case "dafoshanpersonnel":
                return DAFOSHANPERSONNEL;
            case "xinantalent":
                return XINAN_TALENT;
            case "xumutalent":
                return XUMU_TALENT;
            case "mutongtalent":
                return MU_TONG_TALENT;
            case "chenhr":
                return CHENHR;
            case "beiJiXing":
                return BEIJIXING;
            default:
                return null;
        }
    }

    public static ChannelTypeEnum getChannelTypeByValue(Integer value) {
        switch (value) {
            case 1:
                return LAGOU;
            case 2:
                return ZHILIAN;
            case 3:
                return WUYOU;
            case 4:
                return LIEPIN;
            case 5:
                return XMRC;
            case 6:
                return DINGXIANG;
            case 7:
                return KQ36;
            case 8:
                return WUBA;
            case 9:
                return SDRC;
            case 10:
                return MAIMAI;
            case 11:
                return BOSS;
            case 12:
                return SHIXI;
            case 18:
                return GRADUATE;
            case 22:
                return CUSTOM;
            case 23:
                return SHANGTOU;
            case 24:
                return GUOJIRENCAI;
            case 25:
                return BUILDHR;
            case 26:
                return ZHUOBO;
            case 27:
                return ORIENTAL;
            case 28:
                return ZHITONG;
            case 29:
                return DAFOSHANPERSONNEL;
            case 30:
                return XINAN_TALENT;
            case 31:
                return XUMU_TALENT;
            case 32:
                return MU_TONG_TALENT;
            case 33:
                return CHENHR;
            case 35:
                return BEIJIXING;
            default:
                return null;
        }
    }

    public Integer getValue() {
        return value;
    }

    public void setValue(Integer value) {
        this.value = value;
    }

    public String getTargetName() {
        return targetName;
    }

    public void setTargetName(String targetName) {
        this.targetName = targetName;
    }

    public Integer getChannelId() {
        return channelId;
    }

    public void setChannelId(Integer channelId) {
        this.channelId = channelId;
    }

    public Integer getRateLimit() {
        return rateLimit;
    }

    public void setRateLimit(Integer rateLimit) {
        this.rateLimit = rateLimit;
    }
}

